var star = {
  typeId: '',
  visitNum: 0,
  img: '',
  init: function(){
    this.getData()
  },
  getData: function(){
    var data = getTypeDetailInfo(this.typeId)[0]
    this.visitNum = data.visitNum
    this.img = data.typePicture[0].picPath3
    this.render()
  },
  render: function(){
    var html = ''
    html += '<img src="' + this.img + '"/>'
    $('#detail').html(html)
    this.renderVisi();
    $('#info').css("display","block");
  },
  renderVisi: function(){
    var html = ''
    var numArr = (this.visitNum + '').split('')
    for(var i = 0, l = numArr.length; i < l; i++){
      html += '<div class="number number-'+ numArr[i] +'" ></div>'
    }
    html += '<div class="number number-10"></div>'
    $('#visitNum').html(html)
  },
  keyEnter: function () {
    var data = voteColumn(this.typeId)
    if (data.code === 200) {
      this.visitNum = data.data
      this.renderVisi()
      dialog.show('投票成功')
    } else {
      dialog.show(data.msg || '已投票，明天继续投票！')
    }
  }
}